﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Security.Principal;

/// <summary>
/// Description résumée de MemberExtend
/// </summary>
public partial class Member
{
    public List<MembersRelation> Relations()
    {
        var relation_a_ok = iRequested.Where(rel => rel.Status == 1).ToList();
        var relation_b_ok = theyRequested.Where(rel => rel.Status == 1).ToList();
        return relation_a_ok.Concat(relation_b_ok).ToList();
    }

    public Dictionary<Member, MembersRelation> Friends()
    {
        var friends = new Dictionary<Member, MembersRelation>();
        var relation_a_ok = iRequested.Where(rel => rel.Status == 1);
        var relation_b_ok = theyRequested.Where(rel => rel.Status == 1);
        foreach (var relation in relation_a_ok)
        {
            friends.Add(relation.Members1, relation);
        }
        foreach (var relation in relation_b_ok)
        {
            friends.Add(relation.Members, relation);
        }
        return friends;
    }

}